<?php
add_action( 'init', 'demo_custom_pt' );
function demo_custom_pt() {
	register_taxonomy(
		'coursecategory',
		'course',
		array(
			'label' => __( 'Category' ),
			'rewrite' => array( 'slug' => 'course-category'),
			'hierarchical' => true
		)
	);
	
	register_post_type( 'demo_post_type',
		array(
			'labels' => array(
				'name' => __( 'Demo post type' ),
				'singular_name' => __( 'Demo_post_type' ),
				'add_new' => _x('Add New', 'demo_post_type'),
				'add_new_item' => __('Add New demo post type'),
				'edit_item' => __('Edit demo post type'),
				'new_item' => __('New demo post type'),
				'view_item' => __('View demo post type'),
				'search_items' => __('Search demo post type')
			),
		'public' => true,
		'publicly_queryable' => true,
		'has_archive' => true,
		'hierarchical' => false,
		'taxonomies' => array('coursecategory'),
		'supports' => array( 'title', 'editor', 'author',  'comments', 'custom-fields', 'cats')
		)
	);
}